//
//  coreDataController.h
//  QUE_LESS
//
//  Created by Alex on 21/07/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "DEFINES.h"
#import "JSONBLOB.h"

@protocol coreDataControllerDelegate <NSObject>

@optional
-(void)coreDataSaveStatus:(int)statusCode;
-(void)coreDataRetrieveStatus:(int)statusCode;
-(void)coreDataDeleteStatus:(int)statusCode;
@end

@class JSONBLOB;
@interface coreDataController : NSObject

@property (strong,nonatomic) id <coreDataControllerDelegate> delegate;
@property (nonatomic, strong) id jsonObject;
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;

- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;

-(void)saveJSONtoCoreData:(id)JSON;
-(id)retrieveJSONFromCoreData;
-(void)deleteJSONFromCoreData;
@end
